#version 460
#extension GL_GOOGLE_include_directive : enable
#extension GL_EXT_scalar_block_layout : enable

#include "../../../../core/shader_color.h"
#include "../../../../core/shader_widget_color.h"


layout(std430, column_major, binding = DEF_BINDING_WIDGET_LineProp) readonly buffer U_Matrix_5 {
	S_LineProp LineProp[];
};


layout(location = 0) in vec2 vUV;
layout(location = 1) in flat uint gInstanceIndex;
//layout(location = 2) in flat uint controlPointNum;
//layout(location = 2) in flat uint controlPointOffset;

layout(location = 0) out vec4 outColor;

void main(void){
	//vec2 uv = (vUV - 0.5);
	//vec2 coord = normalize(uv);
	//vec3 color = vec3(0);

	vec4 a0 = f_glsl_buildColor(LineProp[gInstanceIndex].m_ColorA);
	vec4 a1 = f_glsl_buildColor(LineProp[gInstanceIndex].m_ColorB);

	outColor = mix(a0, a1, vUV.y);
	//outColor = a1 + 0.5;
	//for(uint i=0; i<controlPointNum; ++i){
	//	if(vUV.y < LineProp[i].m_Gap && vUV.y >= LineProp[i - 1].m_Gap) {
	//		float a = GradientColor[i].a - vUV.y;
	//		color = mix(, GradientColor[i].rgb, a);
	//		//outColor.r = a;
	//	}
	//}
	//outColor = vec4(0.7);
	//outColor.rgb = color;
	//outColor.a = 1;
}


 